package com.sxyjhh.dbutil.basic.handler;


import com.sxyjhh.dbutil.basic.ClientWorkCallback;

/**
 * Description:任务处理接口
 *
 * @JDK Version:1.8.0_40
 * Version: V1.0
 * Author: wangchun
 * Date: 2016/3/22 14:57
 */
public interface WorkHandler<T> {

    /**
     *
     * @param clientWorkParams 启动任务的参数类
     * @param clientWorkCallback 任务执行回调
     * @return 返回任务id
     * @throws Exception
     */
    String startTask(T clientWorkParams, ClientWorkCallback clientWorkCallback)throws Exception;

    /**
     *
     * @param taskId 任务id
     * @return 返回执行结果
     * @throws Exception
     */
    int pauseTask(String taskId)throws Exception;

    /**
     *
     * @param taskId 任务id
     * @return 返回执行结果
     * @throws Exception
     */
    int resumeTask(String taskId)throws Exception;

    /**
     *
     * @param taskId 任务id
     * @return 返回执行结果
     * @throws Exception
     */
    int stopTask(String taskId)throws Exception;

}
